package com.suixinsanren.design.proxy.demo.demo04;

import org.junit.Test;

public class DuckProxyTestDrive {

    @Test
    public void test(){
        Duck duck = new DuckProxy(new WildDuck());
        testDuck(duck);
        testDuck(duck);

        System.out.println(DuckProxy.flyCounter);
        System.out.println(DuckProxy.quackCounter);
    }

    public void testDuck(Duck duck){
        duck.quack();
        duck.fly();
    }
}
